The module system uses Python lists to represent collections of game objects. A Python list starts with a square bracket [, includes a list of objects and ends with a closing square bracket ]. If you open and view any of the module files you will see that it usually contains such a list. We call the objects tuples. Tuples, like lists, contain elements seperated by commas but they start and end with parentheses. Take note that there is no need for a comma when there is only one entry in a list, although the comma is needed when there is only one entry in a tuple.[1] The structure of each tuple object is documented at the beginning of the respective module file.
In this documentation you will find the tuple documentation of the developers always at the beginning of each module_*.py section. Examples for module_*.py files which differ from the normal structure are module_info.py, module_info_pages.py and module_constants.py which will also get addressed first. After observations and examinations of example tuples there will also be all available flags listed which can get used by you.
A flag is an on-or-off state that can be attached to a given value through the use of the bitwise OR "|" masking operator. The name derives from the use of a semaphore signal: when the flag is raised, the state is active, while when the flag is lowered (not present), the state is inactive. In the case of binary, this "flag" translates instead to a single bit from a binary number: if the bit is 1, the state is active, whereas when the number is 0, the state is inactive. By assigning certain bits as flags, the remaining bits can be used for a number and the existence of the flag can be checked using a simple mathematical operation, allowing a single number to store several pieces of information without requiring something more complicated to develope.[1]
In the Mount&Blade scripting language, all objects, functions, and variables are technically just numbers, so flags are added to object IDs and other similar constructs to store additional information about the objects. Flags are pre-defined by the Mount&Blade developers, as only the game engine itself is capable of performing decisions based on the presence or absence of flags in a given identifier.[1]
Be aware: All flags with "mask" and "bits" as part of their name cannot and should not be changed by you! They will therefore also not be listed in this documentation.